﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace cn.Util
{
    /// <summary>
    /// 正则表达式
    /// </summary>
   public class RegularExpressionString
    {
       /// <summary>
       /// Email
       /// </summary>
       public const string Email = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";

       /// <summary>
       /// URL
       /// </summary>
       public const string Url = @"[a-zA-z]+://[^\s]*";

       /// <summary>
       /// 匹配帐号是否合法(字母开头，允许5-16字节，允许字母数字下划线)
       /// </summary>
       public const string LoginId = @"^[a-zA-Z][a-zA-Z0-9_]{4,15}$";

       /// <summary>
       /// 邮政编码
       /// </summary>
       public const string MailCode = @"[1-9]\d{5}(?!\d)";

       /// <summary>
       /// 身份证
       /// </summary>
       public const string Id = @"\d{15}|\d{18}";

       /// <summary>
       /// 浮点数
       /// </summary>
       public const string Double = @"^(-?\d+)(\.\d+)?$";

       /// <summary>
       /// 整数
       /// </summary>
       public const string Int = @"^-?[0-9]\d*$";

       /// <summary>
       /// 非负浮点数
       /// </summary>
       public const string PositiveDouble = @"^\d+(\.\d+)?$";
       
    }
}
